/**
 * 安卓白金英雄坛制作组 <br>
 * 文件名：ArrowButton.java <br>
 * 创建时间：2013-7-22 下午2:27:52 <br>
 * 所属项目：GmudEX <br>
 * @author 12548 <br>
 */
package lostland.gmud.exv2.ui.core;

import lostland.gmud.exv2.Assets;
import lostland.gmud.exv2.Game;
import lostland.gmud.exv2.blgframework.impl.BLGGraphics;

/**
 * 类名：ArrowButton <br>
 * 说明：按钮基类，把辣阁边框换成了箭头喵~
 *
 * @author 12548
 */
public abstract class ArrowButton extends GmudWindow {


	boolean checkEnabled = false;
	boolean checked = false;

	/**
	 * @param instance
	 * @param x
	 * @param y
	 * @param width
	 * @param height
	 */
	public ArrowButton(int x, int y, int width, int height) {
		super(x, y, width, height);
	}

	protected int padding_top;

	@Override
	protected void drawBackground() {
		BLGGraphics g = (BLGGraphics) Game.getInstance().getGraphics();
		if (checkEnabled)
			if (checked)
				if (bordered)
					g.drawPixmap(Assets.checkedfilled, this.x + 1, this.y);
				else
					g.drawPixmap(Assets.checked, this.x + 1, this.y);
			else if (bordered)
				g.drawPixmap(Assets.filled, this.x + 1, this.y);
			else
				g.drawPixmap(Assets.empty, this.x + 1, this.y);
		else if (bordered)
			g.drawPixmap(Assets.arrow, this.x + 1, this.y + padding_top + 2);
	}

	/**
	 * @return checkEnabled
	 */
	public boolean isCheckEnabled() {
		return checkEnabled;
	}

	/**
	 * @param checkEnabled 要设置的 checkEnabled
	 */
	public void setCheckEnabled(boolean checkEnabled) {
		this.checkEnabled = checkEnabled;
	}

	/**
	 * @return checked
	 */
	public boolean isChecked() {
		return checked;
	}

	/**
	 * @param checked 要设置的 checked
	 */
	public void setChecked(boolean checked) {
		this.checked = checked;
	}
}
